#ifndef EVENT_BUS_H
#include <string>
#include <memory>
#include <mutex>
#include <queue>
#include "macro.h"
struct Event {
    int   id;
    char  payload[128];   // 简单定长
};

class EVENT_BUS_API EventBus {
public:
    static EventBus& instance();
    void  push(const Event& e);
    bool  pop(Event& e);          // 非阻塞
private:
    EventBus() = default;
    std::queue<Event> data_queue;
    std::mutex        data_mutex;
};
#endif // !EVENT_BUS_H